package org.i1510.base.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * Kenshinbo@163.com的属性配置
/**
 * @author Administrator
 *
 */
public class KBProperties {
	public static String CLASSPATH = "/config/common/kb.properties";
	public static int PAGESIZE = 0;
	public static String DISALLOW = "";
	/**
	 * 默认密码
	 */
	public static String DEFAULTPASSWORD = "";
	
	/**
	 * 是否允许在Session中找不到userSession时创建匿名
	 */
	public static Boolean ANONYMOUSUSER_ISUSED = false;
	/**
	 * 匿名访问的用户信息-docId
	 */
	public static String ANONYMOUSUSER_DOCID = "";
	/**
	 * 匿名访问的用户信息-name
	 */
	public static String ANONYMOUSUSER_NAME = "";
	/**
	 * 匿名访问的用户信息-nickName
	 */
	public static String ANONYMOUSUSER_NICKNAME = "";
	
	/**
	 * 允许上传的文件类型
	 */
	public static String FILETYPE = "";
	/**
	 * 普通文件存放
	 */
	public static String FILEUPLOAD = "";
	/**
	 * 字节流传输大小(默认大小)
	 */
	public static int INPUTMAX = 1024;		
	/**
	 * 压缩文件临时存放区
	 */
	public static String ZIPTEMP = "";
	/**
	 * sqlite 数据库 地址
	 */
	public static String SQLITE_ADDRESS = "";	
	/**
	 * 超时跳转URL
	 */
	public static String TIMEOUT_URL ;
	/**
	 * 站点URL
	 */
	public static String WEBSITE_URL ;
	/**
	 * 超管
	 */
	public static String SYSSUPERADMIN ;
	/**
	 * 附件为空时下载文件
	 */
	public static String ATTNOPATH ;
	public static String ATTNONAME ;
	public static String ATTNOSUFFIX ;
	static {
		Properties properties = new Properties();
		try {
			properties.load(KBProperties.class.getResourceAsStream(CLASSPATH));
			
			ATTNOPATH = properties.getProperty("att.no.path");
			ATTNONAME = properties.getProperty("att.no.name");
			ATTNOSUFFIX = properties.getProperty("att.no.suffix");
			
			PAGESIZE = Integer.valueOf(properties.getProperty("pageSize"));
			
			DEFAULTPASSWORD = properties.getProperty("defaultpassword");
			
			ANONYMOUSUSER_ISUSED = new Boolean(properties.getProperty("anonymousUser.isUsed"));
			ANONYMOUSUSER_DOCID = properties.getProperty("anonymousUser.docId");
			ANONYMOUSUSER_NAME= properties.getProperty("anonymousUser.name");
			ANONYMOUSUSER_NICKNAME = properties.getProperty("anonymousUser.nickName");			

			FILETYPE= properties.getProperty("fileType");
			FILEUPLOAD = properties.getProperty("fileUpload");
			
			INPUTMAX = StringUtils.String2Integer(properties.getProperty("inputMax"),INPUTMAX) ;
			
			ZIPTEMP = properties.getProperty("zipTemp");
			
			SQLITE_ADDRESS = properties.getProperty("sqlite.address");
			
			TIMEOUT_URL = properties.getProperty("timeout.url");
			WEBSITE_URL = properties.getProperty("website.url");
			DISALLOW = properties.getProperty("sysUser.name.disallow");
			SYSSUPERADMIN = properties.getProperty("sys.super.admin");
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
